Use gtk_size_request_get_size() instead deprecated gtk_widget_get_child_requisition()
authorJavier Jardón <jjardon@gnome.org>
Thu, 9 Sep 2010 13:35:58 +0000 (15:35 +0200)
committerJavier Jardón <jjardon@gnome.org>
Mon, 13 Sep 2010 19:26:01 +0000 (21:26 +0200)
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629177

24 files changed:
gtk/gtkaspectframe.c
gtk/gtkassistant.c
gtk/gtkbbox.c
gtk/gtkcheckbutton.c
gtk/gtkentry.c
gtk/gtkexpander.c
gtk/gtkfixed.c
gtk/gtkfontsel.c
gtk/gtkhandlebox.c
gtk/gtkimagemenuitem.c
gtk/gtklayout.c
gtk/gtkmenubar.c
gtk/gtkmenuitem.c
gtk/gtknotebook.c
gtk/gtkpaned.c
gtk/gtkpathbar.c
gtk/gtkscrolledwindow.c
gtk/gtktable.c
gtk/gtktextlayout.c
gtk/gtktextview.c
gtk/gtktoolbar.c
gtk/gtkviewport.c
gtk/gtkwindow.c
tests/gtkoffscreenbox.c

index 42b709a50fa379a10f923c33c55f9eba6533cfed..8eac4378074f73bfa6076fd0fa19b54a1128cc31 100644 (file)
  */
 
 #include "config.h"
+
 #include "gtkaspectframe.h"
+
+#include "gtksizerequest.h"
+
 #include "gtkprivate.h"
 #include "gtkintl.h"
 
@@ -348,7 +352,8 @@ gtk_aspect_frame_compute_child_allocation (GtkFrame      *frame,
        {
          GtkRequisition child_requisition;
 
-         gtk_widget_get_child_requisition (child, &child_requisition);
+          gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
+                                     &child_requisition, NULL);
          if (child_requisition.height != 0)
            {
              ratio = ((gdouble) child_requisition.width /
index 5cbfe90214a66f64b6e7be2c1225f7a8f33c92c8..334e789202e1be31ef50d9d5eedc4baed2455f23 100644 (file)
@@ -58,6 +58,7 @@
 #include "gtkimage.h"
 #include "gtklabel.h"
 #include "gtksizegroup.h"
+#include "gtksizerequest.h"
 #include "gtkstock.h"
 
 #include "gtkintl.h"
@@ -1224,7 +1225,8 @@ gtk_assistant_size_allocate (GtkWidget      *widget,
   border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
 
   /* Header */
-  gtk_widget_get_child_requisition (priv->header_image, &header_requisition);
+  gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->header_image),
+                             &header_requisition, NULL);
 
   header_allocation.x = border_width + header_padding;
   header_allocation.y = border_width + header_padding;
@@ -1234,7 +1236,8 @@ gtk_assistant_size_allocate (GtkWidget      *widget,
   gtk_widget_size_allocate (priv->header_image, &header_allocation);
 
   /* Action area */
-  gtk_widget_get_child_requisition (priv->action_area, &action_requisition);
+  gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->action_area),
+                             &action_requisition, NULL);
 
   child_allocation.x = border_width;
   child_allocation.y = allocation->height - border_width - action_requisition.height;
@@ -1247,7 +1250,8 @@ gtk_assistant_size_allocate (GtkWidget      *widget,
   gtk_widget_get_allocation (priv->action_area, &action_area_allocation);
 
   /* Sidebar */
-  gtk_widget_get_child_requisition (priv->sidebar_image, &sidebar_requisition);
+  gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->sidebar_image),
+                             &sidebar_requisition, NULL);
 
   if (rtl)
     child_allocation.x = allocation->width - border_width - sidebar_requisition.width;
index 6056e43a8892e460a213467d5bd9f47506aa3e87..5b99cb6949cf417d640532232fccbc4543fa2d3b 100644 (file)
  */
 
 #include "config.h"
+
 #include "gtkbbox.h"
+
 #include "gtkorientable.h"
 #include "gtkprivate.h"
+#include "gtksizerequest.h"
+
 #include "gtkintl.h"
 
 
@@ -474,7 +478,8 @@ gtk_button_box_child_requisition (GtkWidget  *widget,
           if (is_secondary)
             nsecondaries++;
 
-          gtk_widget_get_child_requisition (child, &child_requisition);
+          gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
+                                     &child_requisition, NULL);
 
           if (homogeneous || (child_requisition.width + ipad_w < avg_w * 1.5))
             {
index 727ad5fcafa6c0a1cc569eff810ddc72ac8665d4..35c7e340ee180f5330691f6e440624880656db69 100644 (file)
  */
 
 #include "config.h"
+
 #include "gtkcheckbutton.h"
+
 #include "gtklabel.h"
+#include "gtksizerequest.h"
+
 #include "gtkprivate.h"
 #include "gtkintl.h"
 
@@ -290,8 +294,9 @@ gtk_check_button_size_allocate (GtkWidget     *widget,
          GtkRequisition child_requisition;
           guint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
 
-         gtk_widget_get_child_requisition (child, &child_requisition);
+          gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
+                                     &child_requisition, NULL);
+
          child_allocation.width = MIN (child_requisition.width,
                                        allocation->width -
                                        ((border_width + focus_width + focus_pad) * 2
index 7eb25a09aacc8e19bb783a77864e7fed94d601c4..a1e99c4e982e729b35522adadffe1c30fd02748c 100644 (file)
@@ -53,6 +53,7 @@
 #include "gtkseparatormenuitem.h"
 #include "gtkselection.h"
 #include "gtksettings.h"
+#include "gtksizerequest.h"
 #include "gtkspinbutton.h"
 #include "gtkstock.h"
 #include "gtktextutil.h"
@@ -2990,7 +2991,8 @@ gtk_entry_get_text_area_size (GtkEntry *entry,
   gint frame_height;
   gint xborder, yborder;
 
-  gtk_widget_get_child_requisition (widget, &requisition);
+  gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
+                             &requisition, NULL);
   gtk_widget_get_allocation (widget, &allocation);
   _gtk_entry_get_borders (entry, &xborder, &yborder);
 
@@ -3044,7 +3046,8 @@ get_widget_window_size (GtkEntry *entry,
   GtkRequisition requisition;
   GtkWidget *widget = GTK_WIDGET (entry);
 
-  gtk_widget_get_child_requisition (widget, &requisition);
+  gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
+                             &requisition, NULL);
   gtk_widget_get_allocation (widget, &allocation);
 
   if (x)
@@ -3106,10 +3109,6 @@ gtk_entry_size_allocate (GtkWidget     *widget,
 
   if (gtk_widget_get_realized (widget))
     {
-      /* We call gtk_widget_get_child_requisition, since we want (for
-       * backwards compatibility reasons) the realization here to
-       * be affected by the usize of the entry, if set
-       */
       gint x, y, width, height;
       GtkEntryCompletion* completion;
 
index bedab00d1e2cab2c9c5000b74b9c7f8376446d90..e8f90bd38601feeff1c5379e621632364fc654e8 100644 (file)
@@ -451,7 +451,8 @@ gtk_expander_realize (GtkWidget *widget)
     {
       GtkRequisition label_requisition;
 
-      gtk_widget_get_child_requisition (priv->label_widget, &label_requisition);
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->label_widget),
+                                 &label_requisition, NULL);
       label_height = label_requisition.height;
     }
   else
index 0a461423f5a04a0ac705a867e819465298e35c7d..d7fe2b3a1949d1c9ecce9be43d777700f5edfb5c 100644 (file)
  */
 
 #include "config.h"
+
 #include "gtkfixed.h"
+
+#include "gtksizerequest.h"
+
 #include "gtkprivate.h"
 #include "gtkintl.h"
 
@@ -398,7 +402,8 @@ gtk_fixed_size_allocate (GtkWidget     *widget,
       
       if (gtk_widget_get_visible (child->widget))
        {
-         gtk_widget_get_child_requisition (child->widget, &child_requisition);
+          gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
+                                     &child_requisition, NULL);
          child_allocation.x = child->x + border_width;
          child_allocation.y = child->y + border_width;
 
index 50812d5bc29d8d3d0a02e934d9453c9d052575d0..40a56f6a56a510d5146bc411550a7d095bb38256 100644 (file)
@@ -1173,8 +1173,9 @@ gtk_font_selection_update_preview (GtkFontSelection *fontsel)
   GtkWidget *preview_entry = priv->preview_entry;
   const gchar *text;
 
-  gtk_widget_get_child_requisition (preview_entry, &old_requisition);
-  
+  gtk_size_request_get_size (GTK_SIZE_REQUEST (preview_entry),
+                             &old_requisition, NULL);
+
   rc_style = gtk_rc_style_new ();
   rc_style->font_desc = gtk_font_selection_get_font_description (fontsel);
   
index 423a4f25ef03d0cb1f70778d47bfdc764cb86f37..4fde9822bddaef99a48c1fe75151bfacc4720785 100644 (file)
@@ -645,7 +645,10 @@ gtk_handle_box_size_allocate (GtkWidget     *widget,
   child = gtk_bin_get_child (bin);
 
   if (child)
-    gtk_widget_get_child_requisition (child, &child_requisition);
+    {
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
+                                 &child_requisition, NULL);
+    }
   else
     {
       child_requisition.width = 0;
@@ -1379,7 +1382,10 @@ gtk_handle_box_motion (GtkWidget      *widget,
          priv->child_detached = TRUE;
 
          if (child)
-           gtk_widget_get_child_requisition (child, &child_requisition);
+            {
+              gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
+                                         &child_requisition, NULL);
+            }
          else
            {
              child_requisition.width = 0;
index 8c5a63afa3728f55d1a38ed0f7dae23c187b183f..c1e778bde2183ba93e26adf3557d922261edf01e 100644 (file)
  */
 
 #include "config.h"
+
 #include "gtkimagemenuitem.h"
+
 #include "gtkaccellabel.h"
-#include "gtkintl.h"
 #include "gtkstock.h"
 #include "gtkiconfactory.h"
 #include "gtkimage.h"
@@ -35,6 +36,9 @@
 #include "gtkcontainer.h"
 #include "gtkwindow.h"
 #include "gtkactivatable.h"
+#include "gtksizerequest.h"
+
+#include "gtkintl.h"
 #include "gtkprivate.h"
 
 
@@ -341,8 +345,9 @@ gtk_image_menu_item_toggle_size_request (GtkMenuItem *menu_item,
     {
       GtkRequisition image_requisition;
       guint toggle_spacing;
-      gtk_widget_get_child_requisition (priv->image,
-                                        &image_requisition);
+
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->image),
+                                 &image_requisition, NULL);
 
       gtk_widget_style_get (GTK_WIDGET (menu_item),
                            "toggle-spacing", &toggle_spacing,
@@ -496,8 +501,8 @@ gtk_image_menu_item_size_allocate (GtkWidget     *widget,
        * come up with a solution that's really better.
        */
 
-      gtk_widget_get_child_requisition (priv->image,
-                                        &child_requisition);
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->image),
+                                 &child_requisition, NULL);
 
       gtk_widget_get_allocation (widget, &widget_allocation);
 
index fab1875673ca35abf54d5a53fdfb00976258bb01..822d1ecc9ee6580ac44b1e5c6f6aab0d820e677e 100644 (file)
  */
 
 #include "config.h"
-#include "gdkconfig.h"
 
 #include "gtklayout.h"
+
+#include "gdkconfig.h"
+
+#include "gtksizerequest.h"
+
 #include "gtkprivate.h"
 #include "gtkintl.h"
 #include "gtkmarshalers.h"
@@ -1124,7 +1128,9 @@ gtk_layout_allocate_child (GtkLayout      *layout,
 
   allocation.x = child->x;
   allocation.y = child->y;
-  gtk_widget_get_child_requisition (child->widget, &requisition);
+
+  gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
+                             &requisition, NULL);
   allocation.width = requisition.width;
   allocation.height = requisition.height;
   
index 1cc65e60e49e2bf02b9dfd611581a4fea5b1b584..26d41ef6e285d9cadf7ffd38222f7d4deb704c3a 100644 (file)
  */
 
 #include "config.h"
+
+#include "gtkmenubar.h"
+
 #include "gdk/gdkkeysyms.h"
 #include "gtkbindings.h"
 #include "gtkmain.h"
 #include "gtkmarshalers.h"
-#include "gtkmenubar.h"
 #include "gtkmenuitem.h"
 #include "gtkmenuprivate.h"
 #include "gtksettings.h"
-#include "gtkintl.h"
+#include "gtksizerequest.h"
 #include "gtkwindow.h"
+
+#include "gtkintl.h"
 #include "gtkprivate.h"
 
 #define BORDER_SPACING  0
@@ -424,8 +428,9 @@ gtk_menu_bar_size_allocate (GtkWidget     *widget,
              
              gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child),
                                                 &toggle_size);
-             gtk_widget_get_child_requisition (child, &child_requisition);
-           
+              gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
+                                         &child_requisition, NULL);
+
              if (priv->child_pack_direction == GTK_PACK_DIRECTION_LTR ||
                  priv->child_pack_direction == GTK_PACK_DIRECTION_RTL)
                child_requisition.width += toggle_size;
@@ -474,8 +479,9 @@ gtk_menu_bar_size_allocate (GtkWidget     *widget,
              
              gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child),
                                                 &toggle_size);
-             gtk_widget_get_child_requisition (child, &child_requisition);
-             
+              gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
+                                         &child_requisition, NULL);
+
              if (priv->child_pack_direction == GTK_PACK_DIRECTION_LTR ||
                  priv->child_pack_direction == GTK_PACK_DIRECTION_RTL)
                child_requisition.width += toggle_size;
index 733c965bf97c24c7d5144fd44ec3fa542618db08..02b3a242deed8b15b148f68ea785ccdd7b18c7a0 100644 (file)
@@ -1394,7 +1394,8 @@ gtk_menu_item_size_allocate (GtkWidget     *widget,
       child_allocation.x += allocation->x;
       child_allocation.y += allocation->y;
 
-      gtk_widget_get_child_requisition (child, &child_requisition);
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
+                                 &child_requisition, NULL);
       if (menu_item->submenu && menu_item->show_submenu_indicator) 
        {
          if (direction == GTK_TEXT_DIR_RTL)
index 5585d754338ffba181a401e55058b45093d29594..9e9f5854c8c9e2a52d8b00a7428bc462f5ad710b 100644 (file)
 
 #include "config.h"
 
+#include "gtknotebook.h"
+
 #include <stdio.h>
 #include <string.h>
 
 #include <gdk/gdkkeysyms.h>
 
-#include "gtknotebook.h"
 #include "gtkmain.h"
 #include "gtkmenu.h"
 #include "gtkmenuitem.h"
 #include "gtklabel.h"
+#include "gtksizerequest.h"
 #include "gtkintl.h"
 #include "gtkmarshalers.h"
 #include "gtkbindings.h"
@@ -2199,7 +2201,8 @@ gtk_notebook_size_allocate (GtkWidget     *widget,
                  widget_allocation.y = allocation->y + border_width;
                  is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
 
-                 gtk_widget_get_child_requisition (priv->action_widget[i], &requisition);
+                  gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->action_widget[i]),
+                                             &requisition, NULL);
 
                  switch (tab_pos)
                    {
@@ -5912,7 +5915,8 @@ gtk_notebook_page_allocate (GtkNotebook     *notebook,
   xthickness = style->xthickness;
   ythickness = style->ythickness;
 
-  gtk_widget_get_child_requisition (page->tab_label, &tab_requisition);
+  gtk_size_request_get_size (GTK_SIZE_REQUEST (page->tab_label),
+                             &tab_requisition, NULL);
   gtk_widget_style_get (widget,
                        "focus-line-width", &focus_width,
                        "tab-curvature", &tab_curvature,
index 03f65846d849d61e3303a8708772f2fc117731f7..9b2f31254add3433ac6a2d5c52f8ee5874e5acb0 100644 (file)
 
 #include "config.h"
 
+#include "gtkpaned.h"
+
 #include "gdk/gdkkeysyms.h"
 #include "gtkbindings.h"
 #include "gtkmain.h"
 #include "gtkmarshalers.h"
 #include "gtkorientable.h"
-#include "gtkpaned.h"
+#include "gtksizerequest.h"
 #include "gtkwindow.h"
+
 #include "gtkprivate.h"
 #include "gtkintl.h"
 
@@ -884,8 +887,10 @@ gtk_paned_size_allocate (GtkWidget     *widget,
 
       gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
 
-      gtk_widget_get_child_requisition (priv->child1, &child1_requisition);
-      gtk_widget_get_child_requisition (priv->child2, &child2_requisition);
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->child1),
+                                 &child1_requisition, NULL);
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->child2),
+                                 &child2_requisition, NULL);
 
       old_handle_pos = priv->handle_pos;
 
index bef0f9fb9b7921aeb00ae89be8ecfd3c3ac80ea7..479120cbfca9cb6444007e4fc7a8f7c9c2fba9f0 100644 (file)
  */
 
 #include "config.h"
-#include <string.h>
+
 #include "gtkpathbar.h"
+
+#include <string.h>
+
 #include "gtktogglebutton.h"
 #include "gtkalignment.h"
 #include "gtkarrow.h"
@@ -33,6 +36,7 @@
 #include "gtkhbox.h"
 #include "gtkmain.h"
 #include "gtkmarshalers.h"
+#include "gtksizerequest.h"
 
 
 enum {
@@ -493,7 +497,8 @@ gtk_path_bar_size_allocate (GtkWidget     *widget,
     {
       child = BUTTON_DATA (list->data)->button;
 
-      gtk_widget_get_child_requisition (child, &child_requisition);
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
+                                 &child_requisition, NULL);
 
       width += child_requisition.width + path_bar->spacing;
       if (list == path_bar->fake_root)
@@ -523,7 +528,8 @@ gtk_path_bar_size_allocate (GtkWidget     *widget,
        * button, then count backwards.
        */
       /* Count down the path chain towards the end. */
-      gtk_widget_get_child_requisition (BUTTON_DATA (first_button->data)->button, &child_requisition);
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (BUTTON_DATA (first_button->data)->button),
+                                 &child_requisition, NULL);
 
       width = child_requisition.width;
       list = first_button->prev;
@@ -531,7 +537,8 @@ gtk_path_bar_size_allocate (GtkWidget     *widget,
        {
          child = BUTTON_DATA (list->data)->button;
 
-         gtk_widget_get_child_requisition (child, &child_requisition);
+          gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
+                                     &child_requisition, NULL);
 
          if (width + child_requisition.width +
              path_bar->spacing + slider_space > allocation_width)
@@ -550,7 +557,8 @@ gtk_path_bar_size_allocate (GtkWidget     *widget,
        {
          child = BUTTON_DATA (first_button->next->data)->button;
 
-         gtk_widget_get_child_requisition (child, &child_requisition);
+          gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
+                                     &child_requisition, NULL);
 
          if (width + child_requisition.width + path_bar->spacing + slider_space > allocation_width)
            {
@@ -597,7 +605,8 @@ gtk_path_bar_size_allocate (GtkWidget     *widget,
       button_data = BUTTON_DATA (list->data);
       child = button_data->button;
 
-      gtk_widget_get_child_requisition (child, &child_requisition);
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
+                                 &child_requisition, NULL);
 
       child_allocation.width = MIN (child_requisition.width,
                                    allocation_width - (path_bar->spacing + path_bar->slider_width) * 2);
index 22beb1bc55c41646944a2fe5b388f32d8ffcc3d0..d407876e3f74451c606370600457c154f15f7c5c 100644 (file)
@@ -1346,8 +1346,8 @@ gtk_scrolled_window_relative_allocation (GtkWidget     *widget,
       GtkRequisition vscrollbar_requisition;
       gboolean is_rtl;
 
-      gtk_widget_get_child_requisition (priv->vscrollbar,
-                                       &vscrollbar_requisition);
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->vscrollbar),
+                                 &vscrollbar_requisition, NULL);
       is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
   
       if ((!is_rtl && 
@@ -1363,8 +1363,9 @@ gtk_scrolled_window_relative_allocation (GtkWidget     *widget,
   if (priv->hscrollbar_visible)
     {
       GtkRequisition hscrollbar_requisition;
-      gtk_widget_get_child_requisition (priv->hscrollbar,
-                                       &hscrollbar_requisition);
+
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->hscrollbar),
+                                 &hscrollbar_requisition, NULL);
 
       if (priv->real_window_placement == GTK_CORNER_BOTTOM_LEFT ||
          priv->real_window_placement == GTK_CORNER_BOTTOM_RIGHT)
@@ -1466,8 +1467,9 @@ gtk_scrolled_window_size_allocate (GtkWidget     *widget,
   if (priv->hscrollbar_visible)
     {
       GtkRequisition hscrollbar_requisition;
-      gtk_widget_get_child_requisition (priv->hscrollbar,
-                                       &hscrollbar_requisition);
+
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->hscrollbar),
+                                 &hscrollbar_requisition, NULL);
 
       if (!gtk_widget_get_visible (priv->hscrollbar))
        gtk_widget_show (priv->hscrollbar);
@@ -1517,8 +1519,8 @@ gtk_scrolled_window_size_allocate (GtkWidget     *widget,
       if (!gtk_widget_get_visible (priv->vscrollbar))
        gtk_widget_show (priv->vscrollbar);
 
-      gtk_widget_get_child_requisition (priv->vscrollbar,
-                                       &vscrollbar_requisition);
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->vscrollbar),
+                                 &vscrollbar_requisition, NULL);
 
       if ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL && 
           (priv->real_window_placement == GTK_CORNER_TOP_RIGHT ||
index 0380aa0c39cfb67ee6014a77f97336992fef784c..39b0a971ae1991f30ed41c83406bbd050bf306d6 100644 (file)
  */
 
 #include "config.h"
+
 #include "gtktable.h"
+
 #include "gtkprivate.h"
+#include "gtksizerequest.h"
 #include "gtkintl.h"
 
 
@@ -1064,7 +1067,9 @@ gtk_table_size_request_pass1 (GtkTable *table)
       if (gtk_widget_get_visible (child->widget))
        {
          GtkRequisition child_requisition;
-         gtk_widget_get_child_requisition (child->widget, &child_requisition);
+
+          gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
+                                     &child_requisition, NULL);
 
          /* Child spans a single column.
           */
@@ -1134,8 +1139,9 @@ gtk_table_size_request_pass3 (GtkTable *table)
            {
              GtkRequisition child_requisition;
 
-             gtk_widget_get_child_requisition (child->widget, &child_requisition);
-             
+              gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
+                                         &child_requisition, NULL);
+
              /* Check and see if there is already enough space
               *  for the child.
               */
@@ -1185,7 +1191,8 @@ gtk_table_size_request_pass3 (GtkTable *table)
            {
              GtkRequisition child_requisition;
 
-             gtk_widget_get_child_requisition (child->widget, &child_requisition);
+              gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
+                                         &child_requisition, NULL);
 
              /* Check and see if there is already enough space
               *  for the child.
@@ -1662,7 +1669,8 @@ gtk_table_size_allocate_pass2 (GtkTable *table)
          GtkRequisition child_requisition;
           guint border_width;
 
-         gtk_widget_get_child_requisition (child->widget, &child_requisition);
+          gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
+                                     &child_requisition, NULL);
 
           gtk_widget_get_allocation (GTK_WIDGET (table), &table_allocation);
           border_width = gtk_container_get_border_width (GTK_CONTAINER (table));
index 74b3dd3d6bcf2580d23dd6db7821b0f6572393e7..929810e6a42bcb30e378f093fe68bffc7cfc432a 100644 (file)
@@ -1614,8 +1614,9 @@ add_child_attrs (GtkTextLayout      *layout,
           /* Found it */
           GtkRequisition req;
 
-          gtk_widget_get_child_requisition (child, &req);
-          
+          gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
+                                     &req, NULL);
+
           width = req.width;
           height = req.height;
 
index e49fb01e71ee29c919ad7772bbb32f20bd14754a..dcf2f656f2e4d3f6b684670f97802a032b959206 100644 (file)
@@ -3309,11 +3309,13 @@ gtk_text_view_size_request (GtkWidget      *widget,
           GtkRequisition child_req;
           GtkRequisition old_req;
 
-          gtk_widget_get_child_requisition (child->widget, &old_req);
-          
+          gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
+                                     &old_req, NULL);
+
           gtk_widget_size_request (child->widget, &child_req);
 
-          gtk_widget_get_child_requisition (child->widget, &child_req);
+          gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
+                                     &child_req, NULL);
 
           /* Invalidate layout lines if required */
           if (priv->layout &&
@@ -3358,7 +3360,8 @@ gtk_text_view_compute_child_allocation (GtkTextView      *text_view,
   allocation->x = vc->from_left_of_buffer - text_view->priv->xoffset;
   allocation->y = buffer_y - text_view->priv->yoffset;
 
-  gtk_widget_get_child_requisition (vc->widget, &req);
+  gtk_size_request_get_size (GTK_SIZE_REQUEST (vc->widget),
+                             &req, NULL);
   allocation->width = req.width;
   allocation->height = req.height;
 }
@@ -3459,8 +3462,9 @@ gtk_text_view_allocate_children (GtkTextView *text_view)
           allocation.x = child->x;
           allocation.y = child->y;
 
-          gtk_widget_get_child_requisition (child->widget, &child_req);
-          
+          gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
+                                     &child_req, NULL);
+
           allocation.width = child_req.width;
           allocation.height = child_req.height;
           
index e3f207e80530bbebd6281a6f85b2c8c9e9d9f70d..b6abc357e5087a046f0b3fe4540b4a1e4126eaef 100644 (file)
@@ -32,6 +32,8 @@
 
 #include "config.h"
 
+#include "gtktoolbar.h"
+
 #include <math.h>
 #include <string.h>
 
@@ -51,7 +53,7 @@
 #include "gtkseparatormenuitem.h"
 #include "gtkseparatortoolitem.h"
 #include "gtkstock.h"
-#include "gtktoolbar.h"
+#include "gtksizerequest.h"
 #include "gtktoolshell.h"
 #include "gtkvbox.h"
 #include "gtkprivate.h"
@@ -1454,10 +1456,10 @@ gtk_toolbar_size_allocate (GtkWidget     *widget,
     }
   
   border_width += get_internal_padding (toolbar);
-  
-  gtk_widget_get_child_requisition (GTK_WIDGET (priv->arrow_button),
-                                   &arrow_requisition);
-  
+
+  gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->arrow_button),
+                             &arrow_requisition, NULL);
+
   shadow_type = get_shadow_type (toolbar);
 
   if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
index 59a5084c5e88baece6f0799bc69ca254d37d310a..1244240ad1640c8f56b54fd836fc82d89cd22092 100644 (file)
@@ -443,8 +443,9 @@ viewport_set_hadjustment_values (GtkViewport *viewport,
   if (child && gtk_widget_get_visible (child))
     {
       GtkRequisition child_requisition;
-      
-      gtk_widget_get_child_requisition (child, &child_requisition);
+
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
+                                 &child_requisition, NULL);
       hadjustment->upper = MAX (child_requisition.width, view_allocation.width);
     }
   else
index 05ff63d9ab1eafb45735db41f0109f99a81e82f9..4993df3734052aad649a3894b915db6930216e98 100644 (file)
@@ -5806,7 +5806,8 @@ gtk_window_compute_configure_request_size (GtkWindow *window,
 
   if (priv->need_default_size)
     {
-      gtk_widget_get_child_requisition (widget, &requisition);
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
+                                 &requisition, NULL);
 
       /* Default to requisition */
       *width = requisition.width;
@@ -6727,8 +6728,8 @@ gtk_window_compute_hints (GtkWindow   *window,
   GtkRequisition requisition;
 
   widget = GTK_WIDGET (window);
-  
-  gtk_widget_get_child_requisition (widget, &requisition);
+
+  gtk_size_request_get_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
   geometry_info = gtk_window_get_geometry_info (GTK_WINDOW (widget), FALSE);
 
   if (geometry_info)
@@ -6758,9 +6759,11 @@ gtk_window_compute_hints (GtkWindow   *window,
        *
        * Finding these answers would be a bit of a mess here. (Bug #68668)
        */
-      gtk_widget_get_child_requisition (geometry_info->widget, &child_requisition);
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (geometry_info->widget),
+                                 &child_requisition, NULL);
 
-      gtk_size_request_get_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
+                                 &requisition, NULL);
       extra_width = requisition.width - child_requisition.width;
       extra_height = requisition.height - child_requisition.height;
     }
index 6a4646966cb2a1fee44f2017d87f7d9fa7dd5905..3bf5fd58a348f077fc9653bd4445fcc5b3017249 100644 (file)
@@ -528,7 +528,8 @@ gtk_offscreen_box_size_allocate (GtkWidget     *widget,
       GtkRequisition child_requisition;
       GtkAllocation child_allocation;
 
-      gtk_widget_get_child_requisition (offscreen_box->child1, &child_requisition);
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (offscreen_box->child1),
+                                 &child_requisition, NULL);
       child_allocation.x = child_requisition.width * (CHILD1_SIZE_SCALE - 1.0) / 2;
       child_allocation.y = start_y + child_requisition.height * (CHILD1_SIZE_SCALE - 1.0) / 2;
       child_allocation.width = MAX (1, (gint) allocation->width - 2 * border_width);
@@ -552,7 +553,8 @@ gtk_offscreen_box_size_allocate (GtkWidget     *widget,
       GtkRequisition child_requisition;
       GtkAllocation child_allocation;
 
-      gtk_widget_get_child_requisition (offscreen_box->child2, &child_requisition);
+      gtk_size_request_get_size (GTK_SIZE_REQUEST (offscreen_box->child2),
+                                 &child_requisition, NULL);
       child_allocation.x = child_requisition.width * (CHILD2_SIZE_SCALE - 1.0) / 2;
       child_allocation.y = start_y + child_requisition.height * (CHILD2_SIZE_SCALE - 1.0) / 2;
       child_allocation.width = MAX (1, (gint) allocation->width - 2 * border_width);